PV="6.9-rc7"

require recipes-kernel/linux/linux-yocto.inc
SRCREV ?="933b09ae512973857ec34e3041101e4e502f985a"
SRCREV_machine ?="${SRCREV}"
SRCREV_meta ?="${SRCREV}"
# SRC_URI = "git:///home/myc/worksapce/ls2k0300/source/linux-6.9;protocol=file;branch=master"
SRC_URI = "git://gitee.com/VoldemortCat/linux-6.9.git;protoctol=https;branch=master"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"

LINUX_VERSION ?="6.9-rc7"
DEPENDS += "${@bb.utils.contains('ARCH','x86','elfutils-natives','',d)}"
DEPENDS += "openssl-native util-linux-native"

S= "${WORKDIR}/git"
B = "${S}"


KBUILD_DEFCONFIG ?= "ls2k0300_99_pai_wifi_defconfig"
COMPATIBLE_MACHINE = "loongson-ls2k300"



KERNEL_IMAGETYPE_FOR_MAKE = "fitImage "
# KERNEL_IMAGETYPE_FOR_MAKE:append = "uImage "

#PREFERRED_PROVIDER_virtual/kernel = "linux-loongarch"

do_configure:prepend () {
    if [ -n "${KBUILD_DEFCONFIG}" ] ; then
        echo cp ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${B}/defconfig
        echo ${S} ${WORKDIR} ${B}
        cp ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${B}/defconfig
        cp ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${B}/.config
    fi
}


# do_install:prepend () {
#     cp ${S}/arch/${ARCH}/boot/vmlinux ${S}/arch/${ARCH}/boot/
# }

KERNEL_FEATURES:append = "${KERNEL_EXTRA_FEATURES}"